﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Djs.Neuronic.Medium;
using Djs.Neuronic.Brain;

namespace Djs.Neuronic.UI
{
    public partial class MainForm : Form
    {
        #region Konstrukce
        public MainForm()
        {
            InitializeComponent();
            this.Init();
        }
        private void Init()
        {
            this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing);

            this._FormMoveSupport = new FormMoveSupport(this, this._Label, this._EndButton, this._PrevButton, this._NextButton);
            this.ButtonsInit();
        }
        private FormMoveSupport _FormMoveSupport;
        private void ButtonsInit()
        {
            this._EndButton.ImageNormal = PicLibrary.CrossPink_Cached;
            this._EndButton.ImageHot = PicLibrary.CrossYellow_Cached;
            this._EndButton.ImageDown = PicLibrary.CrossRed_Cached;
            this._PrevButton.ImageNormal = PicLibrary.LeftBlue_Cached;
            this._PrevButton.ImageHot = PicLibrary.LeftYellow_Cached;
            this._PrevButton.ImageDown = PicLibrary.LeftRed_Cached;
            this._NextButton.ImageNormal = PicLibrary.RightGreen_Cached;
            this._NextButton.ImageHot = PicLibrary.RightYellow_Cached;
            this._NextButton.ImageDown = PicLibrary.RightRed_Cached;
        }
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Creator.IsCompleted = true;
        }
        private void _EndButton_Click(object sender, EventArgs e)
        {
            if (!this._EndButton.MouseWasMovingForm)
            {
                this.Creator.IsCompleted = true;
                this.Close();
            }
        }
        #endregion
        #region Public vrstva
        public Djs.Neuronic.Brain.CreatorCls Creator { get; set; }
        #endregion
    }
}
